<?
	require_once "../../_func/__Global.php";
	require_once "../../_func/__Local.php";
	require_once "../../_func/__MysqlFunc.php";
	require_once "../../_func/_MemberFunc.php";
	require_once "../../_func/_Validation.php";

	$id_ = $param->getString("userid");
	$pwd_ = $param->getString("passwd");

	$return_url = $param->getString("return_url");

	$login_info =& Member_CheckLogin($id_, $pwd_);

	if ($login_info['login_state'] <= 0)
		jserror("아이디 또는 비밀번호를 다시 확인하세요.","history.back()",true, true);

	$options = array(
		'domain'	=> $DEFAULT_HOST,
		'path'		=> '/',
	);
	//userlvl : 1:전체관리자, 2:지역농협관리자, 3:지역관리자
	$session->set("userid",  $login_info['userid'],  SESS_SAVE_COOKIE, $options);
	$session->set("userlvl", $login_info['userlvl'], SESS_SAVE_COOKIE, $options);
	$session->set("userno", $login_info['userno'], SESS_SAVE_COOKIE, $options);

	if($return_url == '' || $return_url == null)
		httpRedirect("/");
	else
		httpRedirect($return_url);
?>